package  
{
	import flash.events.IMEEvent;
	import net.flashpunk.Entity;
	import net.flashpunk.graphics.Image;
	import net.flashpunk.masks.Pixelmask;
	import net.flashpunk.FP;
	import net.flashpunk.graphics.Spritemap;
	
	/**
	 * ...
	 * @author Donatello
	 */
	public class EnemyCar extends Entity
	{
		
		[Embed(source = "img/cars/car2.png")]	private const IMG_CAR2:Class;
		[Embed(source = "img/cars/car3.png")]	private const IMG_CAR3:Class;
		[Embed(source = "img/cars/car4.png")]	private const IMG_CAR4:Class;
	
		private var imgCar:Image;
		private var vel:Number;
		
		public function EnemyCar(px:Number,py:Number,nvel:Number) 
		{
			switch(FP.rand(4))
			{
				case 2:imgCar = new Image(IMG_CAR2); mask = new Pixelmask(IMG_CAR2);break;
				case 3:imgCar = new Image(IMG_CAR3);mask = new Pixelmask(IMG_CAR3); break;
				default:imgCar = new Image(IMG_CAR4); mask = new Pixelmask(IMG_CAR4);break;
			}
			
			graphic=imgCar;
			
			type = "EnemyCar";
			
			x = px;
			y = py;
			
			vel = nvel;
		
		
		}
		
		override public function update():void
		{
			y += vel;
		
		}
		
	}

}